home *** CD-ROM | disk | FTP | other *** search
- ATARI MACHINE SPECIFIC LIBRARY
-
-
-
- NAME
- FastFont - high speed proportionally space font display
-
- SYNOPSIS
- #include <FastFont.h>
-
- class FastFont
-
- DESCRIPTION
- Many real-time games and similar applications require a rapidly
- updated on-screen display of text. This module provides fast
- text display in all bit-plane oriented graphics modes. The text
- is draw on a single bitplane of the undisplayed doublebuffer page.
-
- CLASSES
- A FastFont is a description of a text font that can display
- characters or strings of characters at arbitrary (x,y) positions.
-
- CLASS MEMBERS
- FastFont::
-
- FastFont(Screen& s, int w, int h, unsigned char from, unsigned char to)
- Create a font from the graphics on a screen. The graphics is
- assumed to be a sequence of w-pixel by h-pixel blocks. The intial
- "width" of each character will be one pixel more than the distance
- from the left side of the character's block, to the right-most
- "on" pixel of the block. w may be at most 16. Only the given
- range of characters is extracted from the graphics.
-
- FastFont(const char*)
- Create a font from a previously Saved FastFont. The file format
- is AMS-specific. Hopefully, GDOS bitmap fonts will be used later.
-
- int operator! ()
- 1 if construction failed, else 0.
-
- int Save(const char*)
- Save the font in an AMS-specific format. This format may change,
- possibly to the GDOS bitmap font format.
-
- void Plane(short)
- Set the plane on which subsequent Put() operations act. By default,
- the first bitplane (plane 0) is used.
-
- void Put(char, int& x, int y)
- Put a single character at the given co-ordinates, and advance x by
- the width of that character. Characters out of the range specified
- at construction are displayed as the first in-range character.
- The text is placed using EXCLUSIVE OR, that is, pixels are "flipped"
- to draw the text, rather than simply set. This allows for some
- interesting bit-plane effects. It also allows the text to be
- removed by simply re-Putting it, however other techniques are
- usually faster.
-
- void Put(const char*, int& x, int y)
- As above, except a string of characters is displayed, each separated
- by the current spacing (see SetSpacing() below).
-
- short Width(char)
- Returns the width of the given character.
-
- int Width(const char*)
- Returns the width of the given string of characters, including
- spacing between each.
-
- void SetWidth(char,short)
- Set the width of the given character for kerning purposes (does
- not effect character image). By default, each character is the
- width of "on" pixels in its block, as described in the constructor
- above.
-
- void SetSpacing(short)
- Set the spacing used between characters in a string.
-
- SEE ALSO
- FastCounter, Screen, DoubleBuffer
-
- BUGS
- No range checking is performed.
-
- AUTHOR
- Warwick Allison, Christmas 1992.
- warwick@cs.uq.oz.au
-
- COPYING
- This functionality is part of the Atari Machine Specific Library,
- and is Copyright 1992 by Warwick W. Allison.
-
- The Atari Machine Specific Library is free and protected under the
- GNU Library General Public License.
-
- You are free to copy and modify these sources, provided you acknowledge
- the origin by retaining this notice, and adhere to the conditions
- described in the GNU LGPL.
-